home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
sharewar
/
FFE
/
GRAPH.SWG
/
0028_XBM - X Bitmap Format.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-05-11
|
2KB
|
74 lines
Subj : XBM
Keys : XBM,UNIX,LINUX,XWINDOW,BSD,FILE,FORMAT
XBM - X BitMap Format
XBM is a native file format of The X Window System and is used for
storing cursor and icon bitmaps that are used in the X GUI. XBM files
are quite different in that they are actually C language source files
that are created to be read by a C compiler rather than a graphical
display program.
XBM data is typically found in headers (.h files) and are a series of
static unsigned char arrays containing the monochrome pixel data. There
is one array per image stored in the header.
As an example, the following piece of C code is an X BitMap file:
#define test_width 16
#define test_height 16
static unsigned char test_bits[] = {
0xff, 0xff, 0x01, 0x80, 0xfd, 0xbf, 0x05, 0xa0, 0xf5, 0xaf, 0x15, 0xa8,
0xd5, 0xab, 0x55, 0xaa, 0x55, 0xaa, 0xd5, 0xab, 0x15, 0xa8, 0xf5, 0xaf,
0x05, 0xa0, 0xfd, 0xbf, 0x01, 0x80, 0xff, 0xff};
Which defines the 16x16 bitmap that looks like:
################
# #
# ############ #
# # # #
# # ######## # #
# # # # # #
# # # #### # # #
# # # # # # # #
# # # # # # # #
# # # #### # # #
# # # # # #
# # ######## # #
# # # #
# ############ #
# #
################
-----------
XBM was created by the X Consortium as part of the X Window System.
Refer to the /bitmaps directory of the X Window distribution for
examples of XBM files. The central FTP distribution site for X version
11 is:
ftp://ftp.x.org
Reference works describing XBM include:
- Xlib-C language X Interface, Gettys, James, and Robert W. Scheiffler,
Consortium Standard, X Version 11, Release 5, First Revision, August 1991.
- Xlib Programming Manual, Nye, Adrian, third edition, O'Reilly & Associates,
Inc. Sebastopol, CA, 1992.
-----------
Remember, at Unix EOL (End of Line) is "0A" (LF/Line Feed), but in a DOS
compatible system, EOL is "0D 0A" (CR+LF/Carriage Return+Line Feed).
Eduardo Motta Buhrnheim (Mingo)
mingo@n3.com.br
P.O.Box, 3159,
Manaus, Amazonas,
Brazil, 69001-970.
EXTENSIONS: XBM
OCCURENCES: PC,SUN
PROGRAMS: X WINDOW SYSTEM,UNIX,INTERNET BROWSERS